<!--<template>-->
<!--  <div>-->
<!--    <h2>实时消息：</h2>-->
<!--    <p>{{ message }}</p>-->
<!--    <el-button type="primary" @click="send">发送消息</el-button>-->
<!--  </div>-->
<!--</template>-->

<!--<script>-->
<!--import {closeWebSocket, createWebSocket, sendMessage} from '../../utils/webSocket'-->

<!--export default {-->
<!--  data() {-->
<!--    return {-->
<!--      message: '',-->
<!--    }-->
<!--  },-->
<!--  mounted() {-->
<!--    const sessionId = '1'-->
<!--    const wsUrl = `ws://192.168.2.157:8088/ws/upload?type=admin&sessionId=${sessionId}`-->
<!--    createWebSocket(wsUrl, (msg) => {-->
<!--      console.log('收到消息：', msg)-->
<!--    })-->
<!--    // 假设你的后端 WebSocket 地址是 ws://localhost:8080/ws-->
<!--    // createWebSocket('ws://192.168.2.157:8088/ws/upload?type=admin&sessionId=123456', (msg) => {-->
<!--    //   this.message = msg-->
<!--    // })-->
<!--  },-->
<!--  beforeDestroy() {-->
<!--    // 页面关闭或切换时关闭连接-->
<!--    closeWebSocket()-->
<!--  },-->
<!--  methods: {-->
<!--    send() {-->
<!--      const uploadData = {-->
<!--        type: 'image_upload',-->
<!--        userId: 1,-->
<!--        sessionId: 1,-->
<!--        fileName: '1',-->
<!--        fileSize: '100mb',-->
<!--        imageData: ['www.baidu.com'],-->
<!--        timestamp: new Date().toISOString()-->
<!--      }-->
<!--      console.log('消息')-->
<!--      sendMessage(JSON.stringify(uploadData))-->
<!--    },-->
<!--  },-->
<!--}-->
<!--</script>-->





<!--excel-->
